% Toma el parametro subjectList y en funci�n de eso, plotea los resultados
% de la performance de esos sujetos seg�n sea su �ndice en el vector interno
% allSubs
function allPerformance(subjectList, newSubjects)

%chequear si se grafican los datos nuevos o los datos viejos.
if (newSubjects == true)
    allSubs={'nico2'; 'pablo'; 'mariano'; 'mercedes'; 'mabel'; 'cesar'; 'federico'; 'rosario'; 'alberto'};
    allMaleStarts=[18 18 25 30 14 27 14 25 18];
    allFemaleStarts=[28 28 35 40 24 37 24 35 28];
    qtyTrials=350;
    sequenceSize=20;
else
    allSubs={'veronica'; 'blas'; 'juan2'; 'nico'};
    allMaleStarts=[22 21 22 22];
    allFemaleStarts=[29 30 29 29];
    qtyTrials = 300;
    sequenceSize = 40;
end

names=cell(1,length(subjectList));
maleStarts=cell(1,length(subjectList));
femaleStarts=cell(1,length(subjectList));
perf = cell(1,length(subjectList));
xAxis = cell(1,length(subjectList));
for nam=1:length(subjectList)
    names{nam}= allSubs{subjectList(nam)};
    maleStarts{nam}= allMaleStarts(subjectList(nam));
    femaleStarts{nam}= allFemaleStarts(subjectList(nam));
   
end

nSub=length(names);
data=cell(1,nSub);


for sub=1:nSub
    [perf{sub},frac{sub}] = performanceEvolution(names{sub}, qtyTrials, sequenceSize, maleStarts{sub}, femaleStarts{sub});
        
    xAxis{sub} = 1:qtyTrials;
   
end


T = [xAxis; perf];

%plot(T{:});
 
figure(1)
axisVector = [0 300 0.2 1.];
%subplot(2,2,1);
plot(T{:});
title('');
xlabel('Tiempo (ms)'); ylabel('Performance');
legend('veronica','blas','juan','nico'); %noise','kernel');
axis(axisVector);





end